package com.project.web.admin.service.core.impl;

import com.project.mapper.core.StdCodeTypeMapper;
import com.project.model.core.StdCodeType;
import com.project.web.admin.service.common.impl.BaseServiceImpl;
import com.project.web.admin.service.core.StdCodeTypeService;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 编码类型serviceImpl
 */
@Service("stdCodeTypeServiceImpl")
public class StdCodeTypeServiceImpl extends BaseServiceImpl<StdCodeType, Long> implements StdCodeTypeService {

    private static final long serialVersionUID = -2710947291800200678L;

    @Autowired
    private StdCodeTypeMapper stdCodeTypeMapper;

    /**
     * 查询编码类型是否存在
     *
     * @param codeType
     * @return
     */
    public StdCodeType getByCodeType(String codeType) {

        if (StringUtils.isEmpty(codeType)) {
            return null;
        }
        return stdCodeTypeMapper.getByCodeType(codeType);
    }
}
